package jpb.util.load;

import jpb.module.daomain.department.Department;
import jpb.module.daomain.department.LoadDep;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.List;

/**
 * Created by haol on 2017/4/17.
 */
public class LoadExcelUtil {


        private Logger logger = LoggerFactory.getLogger(LoadExcelUtil.class);

        DownExcelUtil downExcelUtil = new DownExcelUtil();
        UpExcelUtil upExcelUtil = new UpExcelUtil();

        public HSSFWorkbook create(List<Department> departments,
                                   String name, String sheetName, String[] head, String[] pros) {

                return downExcelUtil.create(departments, name, sheetName, head, pros);
        }


        public HSSFWorkbook create(List<LoadDep>departments, String name, String sheetName, String[] head) {
                return downExcelUtil.createContainMsg(departments,name,sheetName,head);
        }

        public HSSFWorkbook create(String[] head) {
                String name = "批量注册模板";
                String sheetName = "批量注册模板";
                return downExcelUtil.create(name,sheetName,head);
        }

        public HashMap<String, Object> analyzeTitle(HSSFWorkbook workbook,String[] head) {

                return upExcelUtil.analyzeTitle(workbook, head);

        }

        public HashMap<Integer, List<String[]>> analyzeContent(HSSFWorkbook workbook,int groups,String[] head) {

                return upExcelUtil.analyzeContent(workbook,head,groups);

        }
        public String getFileOid(HSSFWorkbook workbook){
                return upExcelUtil.getFileOid(workbook);
        }

        public HashMap<Integer, List<String[]>> analyzeContent(HSSFWorkbook workbook,String[] head,int groups) {
                int ro = 3;
                return upExcelUtil.analyzeContent(workbook, head,ro,groups);

        }

}
